package com.csdj.t309springboot.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

@Configuration
public class ThreadConfig {
    @Bean("taskExecutor")
    public ThreadPoolExecutor taskExecutor(){
        return new ThreadPoolExecutor(2,10,60L,
                TimeUnit.SECONDS,new LinkedBlockingDeque<Runnable>(1000));

    }

}
